<?php get_instance()->view('common/header');?>
<style type="text/css">
    .portrait{max-width: 100%}
</style>
<div class="page-container home">
    <?php get_instance()->view('common/sidebar');?>
    <div class="page-content-wrapper">
        <div class="page-content">
            <div class="row">
                <div class="col-md-12">
                    <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                    <h3 class="page-title"> <?php echo $title?></h3>
                    <ul class="page-breadcrumb breadcrumb">
                        <li class="btn-group"> <a class="btn default ml_5 return" href="<?php echo getUrl('message/merchant/');?>"><i class="fa fa-chevron-left"></i> 返回</a> </li>
                        <li><i class="fa fa-home"></i> <a href="<?php echo getUrl('message/merchant');?>">消息推送 </a><i class="fa fa-angle-right"></i></li>
                        <li> <a href="javascript:;"><?php echo $title?> </a></li>
                    </ul>
                    <!-- END PAGE TITLE & BREADCRUMB-->
                </div>
            </div>
            <div class="row">
                <div class="col-md-12">
                    <div class="portlet">
                        <div class="portlet-body">
                            <div class="table-container">
                                <table class="table table-bordered table-hover" id="datatable">
                                    <thead>
                                    <tr role="row" class="heading">
                                        <th width="13%" sort="false">推送类别</th>
                                        <th width="17%" sort="false">标题</th>
                                        <th width="30%" sort="false">消息内容</th>
                                        <th width="20%" sort="false">推送时间</th>
                                        <th width="10%" sort="false">推送对象</th>
                                        <th width="10%" sort="false">操作</th>
                                    </tr>
                                    <tr>
                                        <th>
                                            <select name="type" class="form-control form-filter input-sm">
                                                <option value="0" >所有</option>
                                                <?php  foreach ($type as $key=>$item):?>
                                                    <option value="<?php echo $key;?>" ><?php echo $item;?></option>
                                                <?php endforeach;?>
                                            </select>
                                        </th>
                                        <th></th>
                                        <th></th>
                                        <th><input class="form-control form-filter date input-sm" name="star"   type="text" style="width: 50%;float: left" >
                                            <input class="form-control form-filter date input-sm" name="end"   type="text" style="width: 50%;float: left">
                                        </th>
                                        <th></th>
                                        <th>
                                            <div class="btn-group">
                                                <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                                <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                                <ul role="menu" class="dropdown-menu pull-right"><li>
                                                        <a href="javascript:void(0);" class="filter-cancel">重置</a>
                                                    </li></ul>
                                            </div>
                                        </th>
                                    </tr>
                                    </thead>
                                    <tbody></tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<div id="message-model" style="top: 20%;" class="modal fade " role="dialog" aria-labelledby="myModalLabel1" aria-hidden="true">
    <div class="modal-dialog">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">推送明细</h4>
            </div>
            <div class="modal-body">
                <div class="table-container">
                    <input class="form-control form-filter input-sm" name="addtime" type="hidden">
                    <table class="table table-bordered table-hover" id="datatable-message">
                        <thead>
                            <tr role="row" class="heading">
                                <th width="9%" sort="false">头像</th>
                                <th width="35%" sort="false">昵称</th>
                                <th width="35%" sort="false">电话</th>
                                <th width="21%" sort="false">操作</th>
                            </tr>
                            <tr>
                                <th></th>
                                <th><input class="form-control form-filter input-sm" name="nickname" type="text"></th>
                                <th><input class="form-control form-filter input-sm" name="mobile" type="text"></th>
                                <th>
                                    <div class="btn-group">
                                        <a class="btn btn-xs filter-submit btn-default"><i class="fa fa-search"></i> 搜索</a>
                                        <button data-toggle="dropdown" class="btn btn-default dropdown-toggle btn-xs" type="button"><i class="fa fa-angle-down"></i></button>
                                        <ul role="menu" class="dropdown-menu pull-right">
                                            <li><a href="javascript:void(0);" class="filter-cancel">重置</a></li>
                                        </ul>
                                    </div>
                                </th>
                            </tr>
                        </thead>
                        <tbody></tbody>
                    </table>
                </div>
            </div>
            <script type="text/javascript">
                $(function(){
                    var model = $('#message-model');
                    $('.detail-btn').live('click', function(){
                        var date_time = $(this).attr('date_time');
                        model.find('.modal-title').html('推送明细 - '+date_time);
                        model.find('[name="addtime"]').val($(this).attr('time'));
                        datatable_init({
                            src: $("#datatable-message"),
                            sAjaxSource: "<?php echo getUrl('message/merchant/getMerchantDetail');?>",
                            bRetrieve: true,
                            bSort:false
                        });
                        $('#datatable-message').dataTable().fnDraw(true);
                        model.modal();
                    });
                });
            </script>
        </div>
    </div>
</div>
<script type="text/javascript">
    $(function(){
        datatable_init({
            src: $("#datatable"),
            sAjaxSource: "<?php echo getUrl('message/merchant/getMessageList');?>",
            aoColumnDefs : [{
                'bSortable' : false,
                'aTargets' : [ 0,1,2,4,5]
            }]
        });
    });
    $('.date').datepicker({
        changeMonth: true,
        autoclose: true,
        format: "yyyy-mm-dd",
        language: 'zh-CN'
    });
    $('.content').live('mouseover',function(){
        $(this).height('75px');
    });

    $('.content').live('mouseout',function(){
        $(this).height('26px');
    })
</script>
</body>
</html>
